//
//  NSObject+WMUIExtension.m
//  SYMall
//
//  Created by wuzihang on 2019/10/16.
//  Copyright © 2019 Guangzhou Jianing Gaoke Property Managment Co.,Ltd. All rights reserved.
//

#import "NSObject+WMUIExtension.h"
#import <YYModel/YYModel.h>

@implementation NSObject (WMUIExtension)

+ (id)parse:(id)JSON {
    //判断数据类型。数组是一类。剩下的是一类。如果都不是 直接返回JSON
    if ([JSON isKindOfClass:[NSArray class]]) {
        return [NSArray yy_modelArrayWithClass:[self class] json:JSON];
    }
    if ([JSON isKindOfClass:[NSDictionary class] ] || [JSON isKindOfClass:[NSData class]] || [JSON isKindOfClass:[NSString class]]) {
        return [self yy_modelWithJSON:JSON];
    }
    return JSON;
}

@end
